<?php
namespace app\lib;

class Show {

    public static function success($message = "", $result = [], $httpStatus = 200) {
        return json([
            "status" => config("status.success"),
            "message" => $message,
            "result" => $result
        ], $httpStatus);
    }

    public static function fail($message = "", $status = 0, $httpStatus = 200) {
        if ($status == 0) {
            $status = config("status.error");
        }
        return json([
            "status" => $status,
            "message" => $message,
            "result" => []
        ], $httpStatus);
    }
}